﻿namespace study2_11
{
    enum Career
    {
        zhanshi,
        lieren,
        fashi,
    }
    internal class Program
    {
        struct Student
        {
            public
            string name;
            public bool sex;
            public int age;
            public string major;
            public Student(string name, bool sex, int age,string major)
            {
                this.name = name;
                this.sex = sex;
                this.age = age;
                this.major = major;
            }
            public void Speak()
            {
                Console.WriteLine("name" +":"+name);
                Console.WriteLine(age);
                Console.WriteLine(major);
                Console.WriteLine(sex);
            }
        };
        struct Squre
        {
            public int chang;
            public int kuan;
            public Squre(int chang,int kuan)
            {
                this.chang = chang;
                this.kuan = kuan;
            }

            public void Speak() {
                Console.WriteLine(chang);
                Console.WriteLine(kuan);
                Console.WriteLine(chang*kuan);
                Console.WriteLine(chang*2+kuan*2);
            }
        };
        
        public struct Player
        {
            public string name;
            public Career carrer;
            public Player(string name, Career carrer)
            {
                this.name = name;
                this.carrer = carrer;
            }
            public void Atk()
            {
                string o="";
                string s="";
                switch (carrer)
                {
                    case Career.zhanshi:
                        o = "战士";
                        s = "冲锋";
                        break;
                    case Career.lieren:
                        o = "猎人";
                        s = "假死";
                        break;
                    case Career.fashi:
                        o = "法师";
                        s = "奥数冲击";
                        break;
                        default:
                        break;
                }
                Console.WriteLine("{0}{1}发动了{2}",o,name,s);
            }
        }
        

        static void Main(string[] args)
        {
            #region 学员
            //Student s1;
            //s1.name = "li hua";
            //s1.age = 18;
            //s1.major = "xin guan";
            //s1.sex = false;
            //s1.Speak();
            //Student s2 = new Student("xiao hong", true, 20, "ji shuan ji");
            //s2.Speak();
            #endregion
            #region 矩形
            //Squre changfang=new Squre(5,3);
            //changfang.Speak();
            #endregion
            #region 玩家信息
            //Console.WriteLine("请输入你的姓名");
            //string name=Console.ReadLine();
            //try
            //{
            //    Console.WriteLine("请输入职业");
            //    Career xuanzhe=(Career)int.Parse(Console.ReadLine());
            //    Player info = new Player(name, xuanzhe);
            //    info.Atk();
            //}
            //catch {
            //    Console.WriteLine("请输入数字");
            //}
            #endregion
        }
    }
}
